package org.neuedu.chapter02_0609;

public class VariabelDemo13 {
    public static void main(String[] args) {
        // ++ --
        int num = 1;
        num++;
        System.out.println(num);
        System.out.println("----------");
        int i = 1;
        int j = i++;
        System.out.println(i);// 2
        System.out.println(j);// 1
        System.out.println("----------");
        int a = 1;
        int b = ++a;
        System.out.println(a);// 2
        System.out.println(b);// 2
        System.out.println("----------");
        int x = 1;
        System.out.println(x++); // 1
        System.out.println(x); // 2

        // 特殊情况
        int y = 1;
        y = y++;
        System.out.println(y); // 1
    }
}
